<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 输入一个整数,按顺序(从个位到高位)输出这个整数每个位置的数字.
        //  var num = prompt(`请输入一个整数`)
        //  var arr = Array.from(num)
        //  for(var i = 0; i < arr.length; i++) {
        //      console.log(arr[arr.length - i - 1]);
        //  }
        var shu = +prompt('请输入一个数字');

        for (var num = 10; ; num *= 10) {
            if (num == 10) {
                console.log(shu % num)
            } else {
                console.log( parseInt(shu % num / (num / 10)) )
            }
            if (shu / num < 1) {
                break;
            }
        }
    </script>
</head>

<body>

</body>

</html>